#include "State.h"
#include "Context.h"
#include <iostream>
using namespace std;
State::State(){
}

State::~State(){
}

bool State::ChangeState(Context* con,State* st)
{
	con->ChangeState(st);
	return true;
}

void State::ClearState(Context* con)
{
	con->ClearState();
}

ConcreteStateA::ConcreteStateA(){
}

ConcreteStateA::~ConcreteStateA(){
}

void ConcreteStateA::handle(Context* context){
	this->ClearState(context);
	ConcreteStateB* concreteStateB = new ConcreteStateB;
	this->ChangeState(context, concreteStateB);	
}

ConcreteStateB::ConcreteStateB(){
}

ConcreteStateB::~ConcreteStateB(){
}

void ConcreteStateB::handle(Context* context){
	this->ClearState(context);
	ConcreteStateA* concreteStateA = new ConcreteStateA;
	this->ChangeState(context, concreteStateA);
}